﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace teavch.Util.Formatter.Sample.Mvc.Controllers
{
	public class ToolController : Controller
	{
		//
		// GET: /Tool/

		[HttpPost]
		public object FormatCode( [Bind( Prefix = "id" )] string langID, [Bind( Prefix = "code" )] string code )
		{
			try
			{
				code = code.ToString( langID, true, true );
				return code;
			}
			catch ( Exception ex )
			{
				return ex.StackTrace;
			}

		}

	}
}
